{"ast":null,"code":"import _objectSpread from\"/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@babel/runtime/helpers/esm/objectSpread2.js\";import _slicedToArray from\"/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";import React from\"react\";import{Avatar,Name,UserStatus,ContactControl}from\"../index\";import{GetUserDialog}from\"../../containers\";import{getUserName}from\"../../utils/User\";import'./UserProfile.scss';import{jsx as _jsx}from\"react/jsx-runtime\";import{jsxs as _jsxs}from\"react/jsx-runtime\";var UserProfile=function UserProfile(props){var _React$useState=React.useState({items:[]}),_React$useState2=_slicedToArray(_React$useState,2),contents=_React$useState2[0],setContents=_React$useState2[1];React.useEffect(function(){if(props.profile.content){setContents(_objectSpread(_objectSpread({},contents),props.profile.content));}// eslint-disable-next-line react-hooks/exhaustive-deps\n},[props]);return/*#__PURE__*/_jsxs(\"div\",{className:\"profile\",children:[/*#__PURE__*/_jsx(\"div\",{className:\"profile__header\",children:/*#__PURE__*/_jsxs(\"div\",{className:\"profile__header-wrapper\",children:[/*#__PURE__*/_jsx(Avatar,{contentList:contents,alt:getUserName(props.profile),stringForFirstCharacter:getUserName(props.profile),stringForGenerateColor:props.profile.id,shortAvatar:false,selfProfile:props.selfProfile}),/*#__PURE__*/_jsxs(\"div\",{className:\"profile__header-infoName\",children:[/*#__PURE__*/_jsxs(\"div\",{className:\"profile__header-infoName-wrap\",children:[/*#__PURE__*/_jsx(\"p\",{children:\"\\u041F\\u043E\\u043B\\u044C\\u0437\\u043E\\u0432\\u0430\\u0442\\u0435\\u043B\\u044C: \"}),/*#__PURE__*/_jsx(Name,{user:props.profile})]}),/*#__PURE__*/_jsx(UserStatus,{status:true})]})]})}),/*#__PURE__*/_jsxs(\"div\",{className:\"profile__body\",children:[/*#__PURE__*/_jsx(ContactControl,{profile:props.profile,selfProfile:props.selfProfile}),/*#__PURE__*/_jsx(GetUserDialog,{profile:props.profile,selfProfile:props.selfProfile}),/*#__PURE__*/_jsxs(\"div\",{className:\"profile__body-profile\",children:[(props.profile.hideEmail===false||props.profile.hideEmail===undefined)&&/*#__PURE__*/_jsx(\"div\",{className:\"profile__body-profile-field\",children:/*#__PURE__*/_jsxs(\"div\",{className:\"profile__body-profile-field-wrapper\",children:[/*#__PURE__*/_jsx(\"span\",{children:\"Email:\"}),/*#__PURE__*/_jsx(\"span\",{className:\"profile__body-profile-field-bold\",children:props.profile.email})]})})||/*#__PURE__*/_jsx(\"div\",{className:\"profile__body-profile-field--green\",children:/*#__PURE__*/_jsx(\"span\",{className:\"profile__body-profile-field--green\",children:\"Email \\u0431\\u044B\\u043B \\u0441\\u043A\\u0440\\u044B\\u0442\"})}),/*#__PURE__*/_jsx(\"div\",{className:\"profile__body-profile-field\",children:/*#__PURE__*/_jsxs(\"div\",{className:\"profile__body-profile-field-wrapper\",children:[/*#__PURE__*/_jsx(\"span\",{children:\"Nickname:\"}),/*#__PURE__*/_jsx(\"span\",{className:\"profile__body-profile-field-bold\",children:props.profile.nickname})]})}),props.profile.firstName&&/*#__PURE__*/_jsx(\"div\",{className:\"profile__body-profile-field\",children:/*#__PURE__*/_jsxs(\"div\",{className:\"profile__body-profile-field-wrapper\",children:[/*#__PURE__*/_jsx(\"span\",{children:\"\\u0418\\u043C\\u044F:\"}),/*#__PURE__*/_jsx(\"span\",{className:\"profile__body-profile-field-bold\",children:props.profile.firstName})]})}),props.profile.lastName&&/*#__PURE__*/_jsx(\"div\",{className:\"profile__body-profile-field\",children:/*#__PURE__*/_jsxs(\"div\",{className:\"profile__body-profile-field-wrapper\",children:[/*#__PURE__*/_jsx(\"span\",{children:\"\\u0424\\u0430\\u043C\\u0438\\u043B\\u0438\\u044F:\"}),/*#__PURE__*/_jsx(\"span\",{className:\"profile__body-profile-field-bold\",children:props.profile.lastName})]})})]})]})]});};export default UserProfile;","map":{"version":3,"names":["React","Avatar","Name","UserStatus","ContactControl","GetUserDialog","getUserName","UserProfile","props","useState","items","contents","setContents","useEffect","profile","content","id","selfProfile","hideEmail","undefined","email","nickname","firstName","lastName"],"sources":["/Users/poppie/Desktop/development/messenger/app/frontend/src/components/UserProfile/index.tsx"],"sourcesContent":["import React from \"react\";\nimport {UserProfileProps} from \"../../models/props/UserProfileProps\";\nimport {Avatar, Name, UserStatus, ContactControl} from \"../index\";\nimport {GetUserDialog} from \"../../containers\";\nimport {getUserName} from \"../../utils/User\";\nimport {ContentListResponse} from \"../../models/response/ContentListResponse\";\nimport './UserProfile.scss';\n\nconst UserProfile: React.FC<UserProfileProps> = (props) => {\n    const [contents, setContents] = React.useState<ContentListResponse>({items: []});\n\n    React.useEffect(() => {\n        if (props.profile.content) {\n            setContents(\n                {\n                    ...contents,\n                    ...props.profile.content\n                }\n            );\n        }\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n    }, [props]);\n\n    return (\n        <div className=\"profile\">\n            <div className=\"profile__header\">\n                <div className=\"profile__header-wrapper\">\n                    <Avatar\n                        contentList={contents}\n                        alt={getUserName(props.profile)}\n                        stringForFirstCharacter={getUserName(props.profile)}\n                        stringForGenerateColor={props.profile.id}\n                        shortAvatar={false}\n                        selfProfile={props.selfProfile}\n                    />\n                    <div className=\"profile__header-infoName\">\n                        <div className=\"profile__header-infoName-wrap\">\n                            <p>Пользователь: </p>\n                            <Name user={props.profile} />\n                        </div>\n                        <UserStatus status={true} />\n                    </div>\n                </div>\n            </div>\n            <div className=\"profile__body\">\n                <ContactControl profile={props.profile} selfProfile={props.selfProfile} />\n                <GetUserDialog  profile={props.profile} selfProfile={props.selfProfile} />\n                <div className=\"profile__body-profile\">\n                    {\n                        ((props.profile.hideEmail === false ||\n                        props.profile.hideEmail === undefined) &&\n                        <div className=\"profile__body-profile-field\">\n                            <div className=\"profile__body-profile-field-wrapper\">\n                                <span>Email:</span>\n                                <span className=\"profile__body-profile-field-bold\">{props.profile.email}</span>\n                            </div>\n                        </div>\n                        ) ||\n                        <div className=\"profile__body-profile-field--green\">\n                            <span className=\"profile__body-profile-field--green\">Email был скрыт</span>\n                        </div>\n                    }\n                    <div className=\"profile__body-profile-field\">\n                        <div className=\"profile__body-profile-field-wrapper\">\n                            <span>Nickname:</span>\n                            <span className=\"profile__body-profile-field-bold\">{props.profile.nickname}</span>\n                        </div>\n                    </div>\n                    {(props.profile.firstName! &&\n                        <div className=\"profile__body-profile-field\">\n                            <div className=\"profile__body-profile-field-wrapper\">\n                                <span>Имя:</span>\n                                <span className=\"profile__body-profile-field-bold\">{props.profile.firstName}</span>\n                            </div>\n                        </div>\n                    )}\n                    {(props.profile.lastName! &&\n                        <div className=\"profile__body-profile-field\">\n                            <div className=\"profile__body-profile-field-wrapper\">\n                                <span>Фамилия:</span>\n                                <span className=\"profile__body-profile-field-bold\">{props.profile.lastName}</span>\n                            </div>\n                        </div>\n                    )}\n                </div>\n            </div>\n        </div>\n    );\n}\n\nexport default UserProfile;"],"mappings":"2RAAA,MAAOA,MAAK,KAAM,OAAO,CAEzB,OAAQC,MAAM,CAAEC,IAAI,CAAEC,UAAU,CAAEC,cAAc,KAAO,UAAU,CACjE,OAAQC,aAAa,KAAO,kBAAkB,CAC9C,OAAQC,WAAW,KAAO,kBAAkB,CAE5C,MAAO,oBAAoB,CAAC,wFAE5B,GAAMC,YAAuC,CAAG,QAA1CA,YAAuC,CAAIC,KAAK,CAAK,CACvD,oBAAgCR,KAAK,CAACS,QAAQ,CAAsB,CAACC,KAAK,CAAE,EAAE,CAAC,CAAC,oDAAzEC,QAAQ,qBAAEC,WAAW,qBAE5BZ,KAAK,CAACa,SAAS,CAAC,UAAM,CAClB,GAAIL,KAAK,CAACM,OAAO,CAACC,OAAO,CAAE,CACvBH,WAAW,gCAEAD,QAAQ,EACRH,KAAK,CAACM,OAAO,CAACC,OAAO,EAE/B,CACL,CACA;AACJ,CAAC,CAAE,CAACP,KAAK,CAAC,CAAC,CAEX,mBACI,aAAK,SAAS,CAAC,SAAS,wBACpB,YAAK,SAAS,CAAC,iBAAiB,uBAC5B,aAAK,SAAS,CAAC,yBAAyB,wB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